package com.lrr.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lrr.dao.WaterDao;
import com.lrr.entity.QueryVo;
import com.lrr.entity.Water;
import com.lrr.service.WaterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WaterServiceImpl implements WaterService {

    @Autowired
    WaterDao dao;

    @Override
    public PageInfo<Water> list(QueryVo vo, Integer pageNum) {
        PageHelper.startPage(pageNum,5);
        List<Water> list = dao.list(vo);
        return new PageInfo<Water>(list);
    }

    @Override
    public Integer selectById(String name) {
        return dao.selectById(name);
    }

    @Override
    public void add(Water water) {
        dao.add(water);
    }
}
